package com.DHH.Entity.Base;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.hibernate.validator.constraints.Length;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;
import java.util.Set;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 实体类BaseMenu
 * 数据表base_tb_menu
 * 后台菜单表
 * 2017-8-3 12:33:07
 * @author Administrator
 *
 */
@Table(name = "base_tb_menu")
public class BaseMenu  implements Serializable {

	//
	@Id
	@GeneratedValue(generator = "JDBC")
	private Integer id;
	//
	@Length(max = 255, min = 0, message = "长度为0-255个字符")
	private String menuName;
	//
	@NotNull(message = "不能为空")
	@Length(max = 255, min = 0, message = "长度为0-255个字符")
	private String menuIcon;
	//
	@NotNull(message = "不能为空")
	@Length(max = 255, min = 0, message = "长度为0-255个字符")
	private String menuUrl;
	//
	@NotNull(message = "不能为空")
	private Integer parentId;


	public BaseMenu(){

	}

	public void setId(Integer id){
		this.id=id;
	}

	public Integer getId(){
		return this.id;
	}
	public void setMenuName(String menuName){
		this.menuName=menuName;
	}

	public String getMenuName(){
		return this.menuName;
	}
	public void setMenuIcon(String menuIcon){
		this.menuIcon=menuIcon;
	}

	public String getMenuIcon(){
		return this.menuIcon;
	}
	public void setMenuUrl(String menuUrl){
		this.menuUrl=menuUrl;
	}

	public String getMenuUrl(){
		return this.menuUrl;
	}
	public void setParentId(Integer parentId){
		this.parentId=parentId;
	}

	public Integer getParentId(){
		return this.parentId;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;

		BaseMenu baseMenu = (BaseMenu) o;

		if (!id.equals(baseMenu.id)) return false;
		if (!menuName.equals(baseMenu.menuName)) return false;
		if (!menuIcon.equals(baseMenu.menuIcon)) return false;
		if (!menuUrl.equals(baseMenu.menuUrl)) return false;
		return parentId.equals(baseMenu.parentId);
	}

	@Override
	public int hashCode() {
		int result=0;
		if(id!=null)
		{
			result= id.hashCode();
		}
		if(menuName!=null)
		{
			result = 31 * result + menuName.hashCode();
		}
		if(menuIcon!=null)
		{
			result = 31 * result + menuIcon.hashCode();
		}
		if(menuUrl!=null)
		{
			result = 31 * result + menuUrl.hashCode();
		}
		if(parentId!=null)
		{
			result = 31 * result + parentId.hashCode();
		}
		return result;
	}
}
